package ke3;

public class customexception {
    public static void main(String[] args) {
        int age =8;
        if(!(age>=18&&age<=120)){
            throw new ageexception("年龄需要在18-120之间");
        }
        System.out.println("你的年龄正确");
    }
}
class ageexception extends RuntimeException{
    public ageexception(String message){
        super (message);
    }
}
